1. Field of the Invention
The present invention relates to the field of computer systems. More specifically, the present invention relates to method and apparatus for program execution on these computer systems.
2. Background Information
Computer applications (hereinafter application) are typically written and compiled to be executed from random access memory (RAM) against which write as well as read operations may be performed. These "RAM based" applications are also typically written to be "relocatable", that is, executable from any memory locations, thereby allowing the memory to be reused for different applications at different time and providing maximum flexibility for allocating memory to application programs. As such, memory references of a "relocatable" and "RAM based" computer application are dynamically resolved at load time, since their precise locations cannot be guaranteed at compile time.
Memory references in an application can be generally divided into two categories, memory references to memory locations within the application itself, i.e. internal references, or memory references to memory locations outside the application, i.e. external references. Particular examples of internal references include function calls crossing segment boundaries of a segmented application. Particular examples of external references include calls to functions provided by the operating system or environment. The relative locations of these memory references (within the application), also known as "patch sites", are typically identified and included as part of the "relocation information" of the application.
When the application is loaded into RAM in preparation for execution, the application loader uses its knowledge of the allocated memory locations of the application, the relative locations of the "patch sites", and the memory locations of the entry points of the external functions, to determine, or "resolve", the appropriate reference values that should be in the application code. The loader then "patches" or "fixes up" the application by writing these resolved reference values into the "patch sites" of the loaded application.
Since "write once" memory such as read-only-memory (ROM) and "write seldom" memory such as EPROM, or Flash cannot be or "easily" written into, typical applications developed in the above described manner cannot be "fixed up" if they are stored in these "write once/seldom" memory and are to be executed in place (XIP). Thus, traditionally, all XIP applications have to be specifically written to ensure there are no unresolved references at the time they (i.e. the absolute code image) are stored into the "write once/seldom" memory. As a practical matter, this is an extremely complex undertaking for any complex suite of applications, especially if external link libraries are involved.
Also historically, most XIP applications were developed for embedded applications. Due to the constraints of the embedded environments, XIP applications tend to employ overlays. Furthermore, only one XIP application is executed in any point in time, in other words, no multitasking of XIP applications.
With the advent of mobile computing and Personal Computer Memory Card International Association (PCMCIA) Cards, there is a renewed interest in XIP applications. If applications can be executed in place from ROM, Flash memory, PCMCIA cards and the like, it means smaller amount of RAM and/or disk storage may be provided, which would lead to a reduction in size and/or weight of notebook computers. It will be especially desirable if new XIP applications may be "easily" developed, and the large number of existing "RAM based" applications may be automatically "converted" to execute in place instead of having to re-write them. Furthermore, it will be desirable if XIP applications can be multitasked just like the "RAM based" applications.
At least one prior attempt is known to have been made to execute applications in place from ROM for a line of now defunct mobile computers. However, these XIP applications were similar to the traditional XIP embedded applications, i.e. they were specially written using overlays and not having any unresolved applications. Furthermore, the XIP applications had to provide their own memory management, including swapping of the appropriate memory ranges in and out of the processor's address space.
Subsequently, a PCMCIA standard application programming interface (API) was created for XIP applications. It was similar to what was done on the now defunct line of notebook computer in that the XIP applications had to be specially written using overlays and not having any unresolved relocation references. However, the PCMCIA API standardized and supported the required memory management, relieving the XIP applications from having to provide their own memory management. The memory management support is analogous to expanded memory (EMS) on personal computers.
What is needed is an integrated approach that enables conventionally developed "RAM based" applications to be storable and executable in place in "write once/seldom" memory, i.e. ROM, EPROM, EEPROM, Flash etc., in the above described desired manner. As will be described in more detail below, the present invention provides for such methods and apparatus that achieve these and other desired results.